<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		
	</body>
	<script>
		/*console.log(Math.PI*6*6);
		console.log(Math.max(1,33,2,8,7));
		console.log(Math.random());*/
		//随机数
		function aa(min,max){
			let rand=Math.random();
			return(min+Math.round((max-min)*rand));
		}
		let num=aa(1000,40000);
		console.log(num);
		//随机点名
		let name=['张三','李四','摆烂','早八'];
		
		console.log(name[aa(0,name.length-1)]);
		//猜数字
		function cai(min,max){
			let rand=Math.random();
			return(min+Math.floor((max-min)*rand));
		}
		let random=cai(1,10);
		while(true){
			let nume=prompt('请输入一个数字：');
			if (nume===null) {
					break;
			} else if(nume>random){alert('猜大了');
				
			}
			else if(nume<random){alert('猜小了');
				
			}
			else {alert('恭喜你，猜对了');
			break;
				
			}
		}
		
			</script>
</html>
